home *** CD-ROM | disk | FTP | other *** search
/ Aminet 4 / Aminet 4 - November 1994.iso / aminet / comm / dlg / cronshell11.lha / CronShell.doc < prev   
Text File  |  1994-09-20  |  4KB  |  104 lines

  1. CronShell is a DLG/TpTCron utility that allows you to run a program
  2. as though it had been run in the TpTCron environment, without losing
  3. the current directory and without running asynchronously (i.e. it
  4. waits for the program to finish running under TpTCron before
  5. returning control).
  6.  
  7. It is a TOTAL hack!  Though it should be a "well-behaved" hack.
  8.  
  9. THE USER (you) ASSUMES ALL RESPONSIBILITY FOR THE USE OF THIS
  10. PROGRAM.  THE AUTHOR (me) SHALL NOT BE IN ANY WAY LIABLE FOR
  11. ANY DAMAGES BELIEVED TO BE CONNECTED WITH THE USE OF THIS PROGRAM!
  12.  
  13. If you have any questions, e-mail leon@mtu.edu
  14. or on fidonet: leon @ 1:139/950.0
  15.  
  16. VERSION 1.1 uses a write-lock instead of a read-lock.  The
  17. read-lock would return after about 20 seconds.  The write-lock
  18. waits until the pending program has actually completed, which
  19. is what needs to happen for CronShell to be even remotely
  20. reliable.
  21.  
  22. ------------------------------------------------------------------
  23.  
  24.   USAGE:  CronShell <LOCKNAME> <COMAND + ARGS>
  25.   
  26. It requires a lockname, which must be unique and no other process in the
  27. system should attempt to use the same name.  Locknames can be just about
  28. any string that does not contain ":" or "/" and only the first 20 characters
  29. are relevant.
  30.  
  31. The command part should contain exactly what you would normally
  32. use to run the desired command.
  33.  
  34. WHY write such a silly program?
  35. SIMPLE, to get around a bug in PDQ/DLGMail.
  36.  
  37. The environment that PDQ/DLGMail uses to execute commands is severely
  38. broken.  Which means that depending on what version of the OS you
  39. are running, a lot of commands fail to run properly when invoked
  40. under PDQ/DLGMail.  In specific, the newer versions of UnZIP, which
  41. are required for mail packets archived with PkZIP2.04g will not work
  42. with PDQ/DLGMail (at least not on my system).  To make matters worse,
  43. PDQ/DLGMail doesn't even know that the command failed, so it happily
  44. removes your incoming mail for you even though it wasn't successfully
  45. processed.  OUCH!
  46.  
  47. The fix is to change your ZIPEXTRACT configuration to something like:
  48.  
  49. ZIPEXTRACT Fido:CronShell PDQMail_ZIP C:UnZIP %s *.PKT
  50.                           ^^^^^^^^^^^ ^^^^^^^^^^^^^^^^
  51.                              /              \
  52.                    just my attempt        actual command to run.
  53.                    at using a
  54.                    descriptive
  55.                    lockname.
  56.  
  57. The above line allows me to process incoming .ZIP packets unless
  58. something goes wrong.
  59.  
  60. WHAT CAN GO WRONG?
  61.  
  62. PDQ/DLGMail has no idea if the extraction actually worked properly--
  63. that's okay, it didn't have any idea before, either.  But at least
  64. this way, barring a full-disk or lack of memory or some other
  65. (hopefully) avoidable catastrophe, you'll still get your mail.
  66.  
  67. HOW DOES IT WORK?
  68.  
  69. I'm going to tell you exactly what I've done so that you can hopefully
  70. avoid unnecessary unpredictable behavior.
  71.  
  72. CronShell uses the specified lockname to do the equivalent of
  73.  
  74. DLG:GetResource -n lockname -k CronShell
  75. (create T:C_lockname_EXE, which contains:
  76.    CD <current directory where program is to be run>
  77.    <command to run>
  78.    DLG:FreeResource -n lockname -k CronShell
  79. )
  80. DLG:CronEvent ADD 0 Execute T:C_lockname_EXE
  81. DLG:GetResource -n lockname -k CronShell
  82. (delete T:C_lockname_EXE)
  83. DLG:FreeResource -n lockname -k CronShell
  84.  
  85. ....
  86.  
  87. So, QUITE CLEARLY it is a hack....  But it works.
  88.  
  89. Most complications will arise from lockname conflicts, which are not only
  90. necessary for the DLG resource locking, but also for the temporary
  91. shell script naming.
  92.  
  93. CronShell also has other applications, and I'm sure you can think
  94. of at least one.  ;)
  95.  
  96. Enjoy!
  97.  
  98. \Leon
  99. ______________________________________________________________________
  100. |  o__ ----       \\ABCD///Amiga BitSwap Central Dispatch - DLG BB/OS!
  101. | _.>/ _-------    \\BBS// 28K8bps USR V.FC/34  Fido/UUCP(906)482-8248
  102. |(_) \(_)Leon Shaner\\\// <leon@abcd.houghton.mi.us> or <leon@mtu.edu>
  103. |________[MTU - CTS] \\/  ...Non-Conformity is a virtue I hold dear...
  104.